﻿namespace Snipps.Core.Entities
{
    using System;

    public class ProgrammingLang : EntityBase, IEquatable<ProgrammingLang>
    {
        public ProgrammingLang()
        {
            Name = string.Empty;
        }

        public string Name { get; set; }

        public bool Equals(ProgrammingLang other)
        {
            if (other == null)
            {
                return false;
            }

            return string.Equals(Name, other.Name, StringComparison.OrdinalIgnoreCase);
        }

        public override int GetHashCode()
        {
            return 1;
        }

        public static bool operator ==(ProgrammingLang left, ProgrammingLang right)
        {
            return Equals(left, right);
        }

        public static bool operator !=(ProgrammingLang left, ProgrammingLang right)
        {
            return !Equals(left, right);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(obj, this))
            {
                return true;
            }

            return Equals(obj as ProgrammingLang);
        }
    }
}